/*
 * Filename TestStripPriceProfitSchemeController.java 2022年03月24日
 * Copyright © Ehome Co.Ltd. All Rgiths Reserved.
 * @author wuyingchao
 */
package com.ehome.poct.core.controller;

import com.ehome.poct.core.api.dto.check.gold.TestConfPoctStripTypeDTO;
import com.ehome.poct.core.api.dto.order.TestStripPriceProfitDTO;
import com.ehome.poct.core.api.virtual.TestStripPriceProfitService;
import com.ehome.poct.core.api.vo.order.TestStripPriceProfitVO;
import com.ehome.web.controller.AbstractBaseController;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wyc
 * @since 2022/03/24 15:45
 **/
@RestController
@AllArgsConstructor
@Api(tags = "价格方案")
@ApiSupport(author = "wyc")
@RequestMapping("/profits")
public class TestStripPriceProfitController extends AbstractBaseController<TestStripPriceProfitVO, TestStripPriceProfitDTO> {
    private final TestStripPriceProfitService testStripPriceProfitService;
    /**
     * 所有检测项
     * @return
     */
    @ApiOperation("所有检测项")
    @ApiOperationSupport(author = "muqiu")
    @GetMapping("/getDetections")
    public List<TestConfPoctStripTypeDTO> getDetections(){
        return testStripPriceProfitService.getDetections();
    }

    @ApiOperation("删除价格方案原有价格项")
    @ApiOperationSupport(author = "muqiu")
    @DeleteMapping("deleteProfitById/{profitSchemeId}")
    public void deleteProfitById(@PathVariable Long profitSchemeId){
        testStripPriceProfitService.deleteProfitById(profitSchemeId);
    }
}